<script type="text/javascript">

var seconds = 3;
var defaultUrl = "<{$url}>";

<{literal}>
window.onload = function(){
  window.setInterval(redirection, 1000);
}
function redirection(){
	if (seconds <= 0){
		window.clearInterval();
		return;
	}
	seconds --;
	document.getElementById('spanSeconds').innerHTML = seconds;
	if (seconds == 0){
		window.clearInterval();
		location.href = defaultUrl;
	}
}

</script>
<{/literal}>